﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>italki chat</title>
</head>
<body style="margin:0;">
    <iframe style="display:none;" id="ifr_webim" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://chat.italki.com/webim/webimfrm.htm" height="420" width="650"></iframe>
    <div id="div_loading" style="width:100%;padding:200px 0 0 0;text-align:center;">
        <img alt="loading" src="/images/webim/loading.gif" /><br />
        <span style="color:#999; font-size:12px; margin-top:10px; text-align:center; font-family:'trebuchet MS'">Loading...</span>
    </div>
    <div id="div_loading" style="width:100%;padding:200px 0 0 0;text-align:center;">
        <img alt="loading" src="/images/webim/loading.gif" /><br />
        <span style="color:#999; font-size:12px; margin-top:10px; text-align:center; font-family:'trebuchet MS'">Loading...</span>
    </div>
</body>
</html>

<script type="text/javascript">
function $(obj){
    return document.getElementById(obj);
}

function Notify()
{
    try{
    window.opener.document.getElementById('img_chat').src = 'http://www.italki.com/images/webim/icon_chat.gif';
    window.opener.document.getElementById('img_chat').title = 'check your italki Chat for new messages';
    window.opener.document.getElementById('img_chat').alt = 'check your italki Chat for new messages';
    }catch(e){}
}

var toJid = null;
function ChildJidChanged()
{
    if(window.opener.ToChildJid != toJid)
    {
        $('ifr_webim').src = 'http://chat.italki.com/webim/webimfrm.htm?startjid=' + window.opener.ToChildJid;
        toJid = window.opener.ToChildJid;
    }

}

setInterval(
function(){
    ChildJidChanged();
    var symbolIndex = window.location.href.indexOf('#');
    if(symbolIndex >= 0)
    {
        
        var cmd = window.location.href.substring(symbolIndex + 1);
        switch(cmd){
            //父窗口消息灯亮
            case '0':
                Notify();
            break;
            //父窗口WebIM变量置为NULL
            case '1':
                try
                {
                window.opener.WebIM = null;
                }catch(e){}
            break;
            //子窗口加载完毕
            case '2':
                $('div_loading').style.display = 'none';
                $('ifr_webim').style.display = '';
            break;
        }
    }
},20);
window.onunload = function(){
    try{
    window.opener.WebIM = null;
    }catch(e){}
}
</script>

<!-- 统计代码 -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1200794-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<div style="position:absolute; left:-100px; top:-50px; width:100px; height:50px; z-index:1">
<script src="http://static.getclicky.com/17561.js" type="text/javascript"></script>
<noscript><p><img alt="Clicky" src="http://in.getclicky.com/17561-db2.gif" /></p></noscript>
<!-- Start Quantcast tag -->
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
<script type="text/javascript">_qacct="p-e5718rdqgs7A6";quantserve();</script>
<noscript>
<a href="http://www.quantcast.com/p-e5718rdqgs7A6" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-e5718rdqgs7A6.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a>
</noscript>
<!-- End Quantcast tag -->
</div>

<!--
&nbsp;&nbsp;Right now our system is undergoing maintenance.  While this happens, you will not be able to use the "Chat Now" function.  We appreciate your patience.
<script type="text/javascript">
    window.onunload = function(){
        try{
        window.opener.WebIM = null;
        }catch(e){}
    }
</script>
-->
